/////////////////////////////////////////////////////////////////////////////
// Name:        ax_messagebox.h
// Purpose:     An accessible message box implementation
// Author:      Julian Smart
// Modified by: 
// Created:     12/11/05 13:05:56
// RCS-ID:
// Copyright:   (c) Julian Smart
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_MESSAGEBOX_H_
#define _AX_MESSAGEBOX_H_

#include "wx/dialog.h"

#include "ax/ax_ui_adaptation.h"

#define wxYES_TO_ALL        0x00100000
#define wxNO_TO_ALL         0x00200000
#define wxDISPLAY_NEXT_TIME 0x00400000

/**
    @class AxMessageDialog

    An accessible substitute for wxMessageDialog.
 */

class AxMessageDialog: public wxDialog
{    
    DECLARE_DYNAMIC_CLASS( AxMessageDialog )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    AxMessageDialog( );
    AxMessageDialog( wxWindow* parent, const wxString& message, const wxString& caption = _("Message"), int style = wxOK, const wxPoint& pos = wxDefaultPosition );

    /// Creation
    bool Create( wxWindow* parent, const wxString& message, const wxString& caption = _("Message"), int style = wxOK, const wxPoint& pos = wxDefaultPosition );

    /// Creates the controls and sizers
    void CreateControls();

    /// Set the label for the Yes button
    void SetYesLabel(const wxString& text) { m_yesLabel = text; }
    const wxString& GetYesLabel() const { return m_yesLabel; }

    /// Set the label for the No button
    void SetNoLabel(const wxString& text) { m_noLabel = text; }
    const wxString& GetNoLabel() const { return m_noLabel; }

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_YES
    void OnYesClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_YESTOALL
    void OnYestoallClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_NO
    void OnNoClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_NOTOALL
    void OnNotoallClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
    void OnOkClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
    void OnCancelClick( wxCommandEvent& event );

    wxString GetMessage() const { return m_message ; }
    void SetMessage(wxString value) { m_message = value ; }

    int GetMessageDialogStyle() const { return m_messageDialogStyle ; }
    void SetMessageDialogStyle(int value) { m_messageDialogStyle = value ; }

    bool GetDisplayNextTime() const { return m_displayNextTime ; }
    void SetDisplayNextTime(bool value) { m_displayNextTime = value ; }

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );

    /// Should we show tooltips?
    static bool ShowToolTips();

    wxStaticBitmap*     m_staticBitmap;
    wxString            m_message;
    int                 m_messageDialogStyle;
    bool                m_displayNextTime;

    wxString            m_yesLabel;
    wxString            m_noLabel;
    AxSelfVoicing       m_adapter;
};

// Convenience dialog
int AxMessageBox(const wxString& msg, const wxString& caption = _("Message"), int style = wxOK, wxWindow* parent = NULL);

#endif
    // _AX_MESSAGEBOX_H_
